<template>
  <div class="header-container">
    <el-row>
      <el-col :span="4" class="loge">
        <router-link to="/login">
          <img src="../assets/实验室loge截图.png" alt="" />
        </router-link>
      </el-col>
      <el-col :span="16">
        <ul class="navlist">
          <li>
            <router-link to="/" class="custom-router-link">
              首页
            </router-link>
          </li>
          <li>
            <router-link to="/other1" class="custom-router-link">
              其他功能
            </router-link>
          </li>
          <li>
            <router-link to="/other2" class="custom-router-link">
              其他功能
            </router-link>
          </li>
          <li>
            <router-link to="/other3" class="custom-router-link">
              其他功能
            </router-link>
          </li>
          <li>
            <router-link to="/other3" class="custom-router-link">
              其他功能
            </router-link>
          </li>
        </ul>
      </el-col>
      <el-col :span="4">
        <el-avatar :size="50">{{ nikename[0] }}</el-avatar>
      </el-col>
    </el-row>
    <!-- 其他内容 -->
  </div>
</template>
<script>
export default {
  data() {
    return {
      nikename: '游客'
    }
  }
}
</script>

<style scoped>
.el-col {
  font-size: 16px;
  font-weight: bold;
  line-height: 50px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.loge img {
  box-sizing: border-box;
  width: 100px;
  margin-left: 20px;
  transform: translateY(8px);
  margin: 0 10px;
}
.navlist {
  list-style: none;
  display: flex;
  justify-content: space-around;
  width: 500px;
}

/* 修改routerlink样式 */
.custom-router-link {
  text-decoration: none !important; /* 取消未激活状态下的下划线 */
  color: #333 !important; /* 未激活状态下的颜色 */
}
.router-link-exact-active,
.router-link-active {
  color: #1890ff; /* 修改激活状态下的颜色 */
  border-bottom: 2px solid #1890ff; /* 添加下划线效果 */
}
.el-avatar {
  /* 修改头像样式 */
  transform: translateY(4px);
}
</style>
